﻿
using Kalman.Extensions;
using System;

namespace QuDao
{
	/// <summary>
    /// 授权数据对象
    /// </summary>
	public class AuthorizeDto
	{
		/// <summary>
        /// 菜单ID
        /// </summary>
		public int MenuID { get; set; }
		
		///// <summary>
  //      /// 按钮授权：有权限的按钮ID或代码列表，用|分隔
  //      /// </summary>
		//public string ButtonList { get; set; }
	}

	/// <summary>
	/// 授权菜单数据对象
	/// </summary>
	public class AuthorizeMenuDto : AuthorizeDto
    {
		/// <summary>
		/// 菜单名称
		/// </summary>
		public string MenuName { get; set; }

		/// <summary>
		/// 菜单类型：1-平台，2-运营，3-门店，4-村庄
		/// </summary>
		public int MenuType { get; set; }

		/// <summary>
		/// 上级ID：默认值为0
		/// </summary>
		public int ParentID { get; set; }

		/// <summary>
		/// 菜单Url
		/// </summary>
		public string Url { get; set; }

		private string _Icon = string.Empty;
		/// <summary>
		/// 图标：图标CSS样式或者图标图片地址
		/// </summary>
		public string Icon { 
			get
			{
                //雪花：f-icon-snowflake-o,纸飞机：f-icon-paper-plane-o,send-o,星号：star,star-o,叶子envira,delicious,wpforms
                if (_Icon.IsNullOrEmpty()) _Icon = "f-icon-wpforms";
				return _Icon;
			}
			set
			{
                _Icon = value;
			}
		}

		/// <summary>
		/// 排序标志：值大的排前面
		/// </summary>
		public int SortFlag { get; set; }

		/// <summary>
		/// 是否启用：0禁用，1启用
		/// </summary>
		public bool IsEnable { get; set; }
	}
}